﻿(function () {
    'use strict';
    var id = 'tableDirective';
    angular.module('app').directive(id,
    ['$window', 'common', tableDirective]);

    function tableDirective($window,common) {
   
        var directive = {
            link: link,
            restrict: 'C',
            templateUrl: '/js/partials/table.html'
        };
        return directive;

        function link(scope, element, attrs) {

            console.log(scope.$id);

            scope.$watch(function () {
                return common.inMemoryData.peopleList;
                console.log(common.inMemoryData.peopleList);
            }, function (newVal) {
                scope.people = newVal;
            });
        }
    }

})();